package com.yxx.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * OSS 配置类
 * @author yuxiangxun
 * @date 2025/2/26
 * @apiNote
 */
@Configuration
public class OssConfig {
    @Value("${upload.oss.endpoint}")
    private String endpoint;

    @Value("${upload.oss.accessKeyId}")
    private String accessKeyId;

    @Value("${upload.oss.accessKeySecret}")
    private String accessKeySecret;


    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}
